hackerrank java loops ii problem

visit shbcf.ru